<?php
/**
 * Created by PhpStorm.
 * User: andyge
 * Date: 15/11/7
 * Time: 下午8:13
 */

include_once("../libs/login.php");

#echo "user:".$_POST['user']."</br>";
#echo "password:".$_REQUEST['pass']."</br>";

$user_pass = array("admin"=>"admin","guest"=>"guest");

$user = $_POST['user'];
$pass = $_POST['pass'];
if($user_pass[$user] != $pass) {
    #echo "user and passworld not valid.</br>";
    header("location:login.php?logintip=用户或者密码不正确");
}

$login = new Login();
$login->set_login_user($user);
header("location:index.php?sid=".session_id());

?>